﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using ffmpeg;

namespace serviceMonitor
{
	public partial class FfmpegMonitor : ServiceBase
	{
		Monitor monitor = null;

		public FfmpegMonitor()
		{
			InitializeComponent();
		}

		internal void Inicializar()
		{
			string[] extensiones = Properties.Settings.Default.VideoExtensions.Split('.');
			monitor = new Monitor(
					Properties.Settings.Default.QueueFilename,
					Properties.Settings.Default.FolderToMonitor,
					Properties.Settings.Default.FfmpegPath,
					Properties.Settings.Default.FfmpegName,
					new List<string>(extensiones),
					Properties.Settings.Default.VideoCodecRegex,
					Properties.Settings.Default.AudioCodecRegex,
					Properties.Settings.Default.SharedFolder);
		}

		protected override void OnStart(string[] args)
		{
			this.Inicializar();
		}

		protected override void OnStop()
		{
		}
	}
}
